package com.pshcp.patient.tool;

import com.external.ws.soap.entity.dto.CasePrintDTO;
import com.framework.base.TwoDTO;
import com.pshcp.domain.model.Patient;
import com.pshcp.patient.domain.medicalprint.ao.OutMedicalListAO;
import com.pshcp.patient.domain.medicalprint.vo.MedicalPrintListVO;

import java.util.ArrayList;
import java.util.List;

public class PatientMedicalPrintTools {

    public static CasePrintDTO buildWsDTO(Patient patient, OutMedicalListAO listAO){
        CasePrintDTO dto = new CasePrintDTO();
        dto.setPatName(patient.getName());
        dto.setIdCardNo(patient.getIdCardNo());
        dto.setPatCardNo(patient.getPatientCardNo());
        //default
        dto.setIdCardType("IIT1");
        dto.setPatCardType("0");

        TwoDTO<String, String> startEndTime = PatientCommonTools.buildStartEndTime(listAO.getSearchTime());
        dto.setStartDate(startEndTime.getOne());
        //0住院病历  结束时间必传；1门诊病历，结束时间不传
        if("0".equals(listAO.getType())){
            dto.setEndDate(startEndTime.getTwo());
        }
        return dto;
    }

    public static List<MedicalPrintListVO> buildTestData(){
        List<MedicalPrintListVO> voList = new ArrayList<>();
        MedicalPrintListVO vo = new MedicalPrintListVO();
        vo.setApplyFlag(1);
        vo.setAccMrId("123456");
        vo.setDeptName("口腔科");
        vo.setDistName("东院");
        vo.setDocName("王萌");
        vo.setIllName("牙疼");
        vo.setInHosDate("2022-12-01");
        vo.setLeaveHosDate("2022-12-11");
        vo.setMedicalRecordNumber("No000001");
        vo.setPhoneNo("138****1234");
        vo.setIdCardNo("100100101010***111");
        vo.setIdCardType("1");

        voList.add(vo);
        return voList;
    }

}
